#include <iostream>
#include <curl/curl.h>
#include <sqlite3.h>

using namespace std;

int main() {
    sqlite3 *db;
    char** res=NULL;
    int row,col;
    char *err=NULL;
    sqlite3_open("data.db",&db);

    sqlite3_get_table(db,"select * from user ;",&res,&row,&col,&err);

    int count=(row*col)+col;

    
    for (int i = 0; i < count; i++)
    {
    	if (i<4)
    	{
    		continue;
    	}
    	std::cout << res[i] << endl;
    }
    
   
    char sql1[]="insert into user (nickname,age,mobile) values('haha',44,'19033332222'); ";

    sqlite3_exec(db,sql1,NULL,0,&err);


    char sql2[]="update user set age=40 where id=1;";
    
    sqlite3_exec(db,sql2,NULL,0,&err);
    

    char sql3[]="delete from user where id=5;";
    
    sqlite3_exec(db,sql3,NULL,0,&err);
}





